home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / diff / diff_150.zoo / makefile < prev    next >
Encoding:
Makefile  |  1992-05-04  |  3.7 KB  |  110 lines

  1. # Makefile for GNU DIFF
  2. # Copyright (C) 1988, 1989 Free Software Foundation, Inc.
  3.  
  4. # This file is part of GNU DIFF.
  5.  
  6. # GNU DIFF is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 1, or (at your option)
  9. # any later version.
  10. # GNU DIFF is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with GNU DIFF; see the file COPYING.  If not, write to
  16. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. # You can compile this with ordinary cc as well,
  19. # but gcc makes it faster.
  20. # Also, gcc supports -O and -g together.
  21. SHELL = /bin/bash.ttp
  22.  
  23. CC = /bin/gcc.ttp
  24. CFLAGS = -O2 -fomit-frame-pointer -finline-functions -fwritable-strings -fstrength-reduce
  25. INSTALL = /bin/install.ttp
  26.  
  27. # On system V, enable these three lines:
  28. # CFLAGS = -g -DUSG
  29. # LIBS = -lPW
  30. # INSTALL = cp
  31. # (If you compile with GCC, you don't need to define LIBS.)
  32. # And, depending on the names and contents of your header files,
  33. # add either -DHAVE_NDIR or -DHAVE_DIRECT or both to CFLAGS.
  34. # Add -DHAVE_NDIR to CFLAGS if your system used ndir.h instead of dirent.h
  35. # Add -DHAVE_DIRECT to CFLAGS if your system uses 'struct direct' instead of
  36. # 'struct dirent' (this is the case at least with one add-on ndir library).
  37.  
  38. # Use these definitions for XENIX:
  39. # There are rumors of bugs in various Xenix's dirent.h and -ldir.  As
  40. # a result, we suggest using HAVE_NDIR and not using -ldir.
  41. # CFLAGS = -O -DUSG -DXENIX -DHAVE_NDIR -DHAVE_DIRECT -DNDIR_IN_SYS
  42. # LIBS = -lx -lPW
  43. # INSTALL = cp
  44.  
  45. # Some System V machines do not come with libPW.  If this is true, use
  46. # the GNU alloca by switching the comment on the following lines.
  47. ALLOCA = 
  48. # ALLOCA = $(archpfx)/alloca.o
  49.  
  50. bindir=/bin
  51. prefix=
  52. archpfx=
  53.  
  54. # All source files
  55. srcs=diff.c analyze.c io.c context.c ed.c normal.c ifdef.c util.c dir.c \
  56.     version.c diff.h regex.c regex.h limits.h diff3.c \
  57.     getopt.c getopt1.c getopt.h alloca.c
  58. # Object files for diff only.
  59. objs=$(archpfx)diff.o $(archpfx)analyze.o $(archpfx)io.o $(archpfx)context.o \
  60.      $(archpfx)ed.o $(archpfx)normal.o $(archpfx)util.o $(archpfx)dir.o \
  61.      $(archpfx)regex.o $(archpfx)ifdef.o $(archpfx)version.o \
  62.      $(archpfx)getopt.o $(archpfx)getopt1.o
  63. tapefiles = $(srcs) README diagmeet.note Makefile COPYING ChangeLog
  64.  
  65. all: $(archpfx)diff.ttp $(archpfx)diff3.ttp
  66.  
  67. $(archpfx)diff3.ttp: $(archpfx)diff3.o
  68.     $(CC) -o $(archpfx)diff3.ttp $(CFLAGS) $(LDFLAGS) $(archpfx)diff3.o $(LIBS)
  69.  
  70. $(archpfx)diff.ttp: $(objs)
  71.     $(CC) -o $(archpfx)diff.ttp $(CFLAGS) $(LDFLAGS) $(objs) $(LIBS)
  72.  
  73. $(objs): diff.h
  74.  
  75. $(archpfx)context.o $(archpfx)diff.o: regex.h
  76.  
  77. $(archpfx)diff3.o: diff3.c
  78.     $(CC) -c $(CFLAGS) -DDIFF_PROGRAM=\"$(bindir)/diff.ttp\" diff3.c \
  79.  $(OUTPUT_OPTION)
  80.  
  81. clean:
  82.     rm -f *.o $(archpfx)diff.ttp $(archpfx)diff3.ttp diff.tar diff.tar.Z
  83.  
  84. install: install-diff install-diff3
  85.  
  86. install-diff: $(prefix)$(bindir)/diff.ttp
  87.  
  88. $(prefix)$(bindir)/diff.ttp: $(archpfx)diff.ttp
  89.     $(INSTALL) $(archpfx)diff.ttp $(prefix)$(bindir)/diff.ttp
  90.  
  91. install-diff3: $(prefix)$(bindir)/diff3.ttp
  92.  
  93. $(prefix)$(bindir)/diff3.ttp: $(archpfx)diff3.ttp
  94.     $(INSTALL) $(archpfx)diff3.ttp $(prefix)$(bindir)/diff3.ttp
  95.  
  96. diff.tar: $(tapefiles)
  97.     mkdir tmp
  98.     mkdir tmp/diff
  99.     -ln $(tapefiles) tmp/diff
  100.     for file in $(tapefiles); do \
  101.         if [ ! -r tmp/diff/$$file ]; then cp $$file tmp/diff; fi \
  102.     done
  103.     cd tmp; tar cf ../diff.tar diff
  104.     rm -rf tmp
  105.  
  106. diff.tar.Z: diff.tar
  107.     compress < diff.tar > diff.tar.Z
  108.